<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../../tpl/head.jsp"%>
<link rel="stylesheet" href="statics/css/secondarytitle.css">
<link rel="stylesheet" href="statics/css/ExportBusiness/tpl/newupoffer.css">
<div class="layui-fluid">
    <div class="layui-card">
        <div class="header">
            <img class="img " src="statics/images/titheader.svg">
            <span>增加，修改采购</span>
        </div>
        <div class="layui-card-body">
            <form class="layui-form" action="" lay-filter="editor-form">
                <input type="hidden" id="id" name="id">

                <%--                start--%>
                <dl class="layui-row sk_row">
                    <dd class="layui-col-md3">
                        <div class="layui-col-xs4 text-right padding-right">
                            <text>供应商名称</text>
                        </div>
                        <div class="layui-col-xs8">
                            <select lay-search name="supplierCode" id="supplierCode" lay-filter="supplierFilter" lay-verify="required">
                                <option value=""></option>
                            </select>
                            <input type="hidden" name="supplierName" id="supplierName">
                        </div>
                    </dd>
                    <dd class="layui-col-md3">
                        <div class="layui-col-xs4 text-right padding-right">
                            <text>采购单号</text>
                        </div>
                        <div class="layui-col-xs8">
                            <input type="text" id="purchaseOrderNo" name="purchaseOrderNo" <%--placeholder="导入成品/配件后生成"--%> autocomplete="off" class="layui-input" lay-verify="required">
                            <input type="hidden" id="boxStatus" name="boxStatus">
                            <input type="hidden" id="newBillNo" name="newBillNo">
                        </div>

                    </dd>
                    <dd class="layui-col-md3">
                        <div class="layui-col-xs4 text-right padding-right">
                            <text>付款账期</text>
                        </div>
                        <div class="layui-col-xs8"> <input type="text" id="paymentTime" name="paymentTime" autocomplete="off" class="layui-input" lay-verify="required|number" disabled="disabled"></div>
                    </dd>

                    <dd class="layui-col-md3">
                        <div class="layui-col-xs4 text-right padding-right">
                            类型
                        </div>
                        <div class="layui-col-xs8">
                            <select name="purchaseType" id="purchaseType" lay-verify="required" disabled>
                                <option value=""></option>
                                <option value="1">成品</option>
                                <option value="2">配件</option>
                                <option value="3">备货</option>
                                <option value="4">销售</option>
                            </select>
                        </div>
                    </dd>


                    <dd class="layui-col-md3">
                        <div class="layui-col-xs4 text-right padding-right">
                            <text>签约公司</text>
                        </div>
                        <div class="layui-col-xs8">
                            <select lay-search name="companyCode" id="companyCode" lay-filter="complaintUnitSelect" lay-verify="required">
                                <option value=""></option>
                            </select>
                            <input type="hidden" name="companyName" id="companyName">
                        </div>
                    </dd>
                    <dd class="layui-col-md3">
                        <div class="layui-col-xs4 text-right padding-right">
                            签约日期
                        </div>
                        <div class="layui-col-xs8"> <input type="text" name="signTime" id="signTime" lay-verify="required|date" autocomplete="off" class="layui-input starttime" placeholder="年 - 月 - 日" lay-verify="required"></div>
                    </dd>
                    <dd class="layui-col-md3">
                        <div class="layui-col-xs4 text-right padding-right">
                            联系人
                        </div>
                        <div class="layui-col-xs8">
                            <select lay-search name="contactPerson" id="contactPerson" lay-filter="contactPerson">
                                <option value=""></option>
                            </select>
                        </div>
                    </dd>
                    <dd class="layui-col-md3">
                        <div class="layui-col-xs4 text-right padding-right">
                            联系人邮箱
                        </div>
                        <div class="layui-col-xs8"><input type="text" name="contactEmail" id="contactEmail" autocomplete="off" class="layui-input" lay-verify="required"></div>
                    </dd>

                    <dd class="layui-col-md3">
                        <div class="layui-col-xs4 text-right padding-right">
                            <text>付款类型</text>
                        </div>
                        <div class="layui-col-xs8"><select lay-search name="paymentType" id="paymentType" lay-filter="paymentTypeFilter" lay-verify="required" disabled="disabled">
                            <option value=""></option>
                        </select></div>
                    </dd>
                    <dd class="layui-col-md3">
                        <div class="layui-col-xs4 text-right padding-right">
                            <text>交货日期</text>
                        </div>
                        <div class="layui-col-xs8"><input type="text" name="deliverDate" id="deliverDate" lay-verify="required|date" autocomplete="off" class="layui-input" placeholder="年 - 月 - 日"></div>
                    </dd>
                    <dd class="layui-col-md3">
                        <div class="layui-col-xs4 text-right padding-right">
                            <text>交货地点</text>
                        </div>
                        <div class="layui-col-xs8"><input type="text" name="deliverAddress" autocomplete="off" class="layui-input" lay-verify="required"></div>
                    </dd>
                    <dd class="layui-col-md3">
                        <div class="layui-col-xs4 text-right padding-right">
                            银行
                        </div>
                        <div class="layui-col-xs8"><select lay-search name="bank" id="bank" lay-filter="bank" lay-verify="required">
                            <option value=""></option>
                        </select></div>
                    </dd>
                    <dd class="layui-col-md3">
                        <div class="layui-col-xs4 text-right padding-right">
                            采购总额
                        </div>
                        <div class="layui-col-xs8"> <input type="text" name="purchaseTotalPrice" id="purchaseTotalPrice" autocomplete="off" class="layui-input" lay-verify="required|number"></div>
                    </dd>
                    <dd class="layui-col-md3">
                        <div class="layui-col-xs4 text-right padding-right">
                            <text>币种</text>
                        </div>
                        <div class="layui-col-xs8"><select lay-search name="currency" id="currency" lay-filter="currencyFilter" lay-verify="required">
                            <option value=""></option>
                        </select></div>
                    </dd>
                    <dd class="layui-col-md3">
                        <div class="layui-col-xs4 text-right padding-right">
                            <text>人民币汇率</text>
                        </div>
                        <div class="layui-col-xs8"><input type="text" id="rmbRate" name="rmbRate" autocomplete="off" class="layui-input" lay-verify="required|number"></div>
                    </dd>
                    <dd class="layui-col-md3">
                        <div class="layui-col-xs4 text-right padding-right">
                            <text>美元汇率</text>
                        </div>
                        <div class="layui-col-xs8"> <input type="text" id="usdRate" name="usdRate" autocomplete="off" class="layui-input" lay-verify="required|number"></div>
                    </dd>
                    <dd class="layui-col-md3">
                        <div class="layui-col-xs4 text-right padding-right">
                            操作员
                        </div>
                        <div class="layui-col-xs8">
                            <!-- 操作员名称 -->
                            <input type="hidden" name="executorName" id="executorName">
                            <select name="executorCode" id="executor" lay-search lay-verify="required" lay-filter="executorFilter">
                                <option value=""></option>
                            </select>
                        </div>
                    </dd>
                    <dd class="layui-col-md3">
                        <div class="layui-col-xs4 text-right padding-right">
                            业务员
                        </div>
                        <!-- 业务员名称 -->
                        <input type="hidden" name="salesmanName" id="salesmanName">
                        <div class="layui-col-xs8">
                        <select name="salesmanCode" id="salesman" lay-search lay-verify="required" lay-filter="salesmanFilter">
                            <option value=""></option>
                        </select>

                        </div>
                    </dd>
                    <dd class="layui-col-md3">
                        <div class="layui-col-xs4 text-right padding-right">
                            定金比例(%)
                        </div>
                        <div class="layui-col-xs8"><input type="text" name="earnestRate" id="earnestRate" autocomplete="off" class="layui-input" lay-verify="required|number"></div>
                    </dd>
                    <dd class="layui-col-md3">
                        <div class="layui-col-xs4 text-right padding-right">
                            定金金额
                        </div>
                        <div class="layui-col-xs8"><input type="text" name="earnestMoney" id="earnestMoney" autocomplete="off" class="layui-input" lay-verify="required|number"></div>
                    </dd>
                    <dd class="layui-col-md3">
                        <div class="layui-col-xs4 text-right padding-right">
                            <text>是否开票</text>
                        </div>
                        <div class="layui-col-xs8"> <select lay-search name="invoiceStatus" id="invoiceStatus" lay-filter="makeinvoice" lay-verify="required">
                            <option value=""></option>
                            <option value="1">是</option>
                            <option value="2">否</option>
                        </select></div>
                    </dd>
                    <dd class="layui-col-md3">
                        <div class="layui-col-xs4 text-right padding-right">
                            <text>是否含税</text>
                        </div>
                        <div class="layui-col-xs8"> <select lay-search name="taxIncluded" id="taxIncluded" lay-filter="taxFilter" lay-verify="required">
                            <option value="1">含税出厂价</option>
                            <option value="2">未税出厂价</option>
                            <option value="3">含税FOB价</option>
                            <option value="4">未税FOB价</option>
                        </select></div>
                    </dd>
                    <dd class="layui-col-md3">
                        <div class="layui-col-xs4 text-right padding-right">
                            <text>是否走信保订单</text>
                        </div>
                        <div class="layui-col-xs8">
                            <select lay-search name="whetherCreditGuarantee" id="whetherCreditGuarantee" lay-filter="whetherCreditGuarantee" disabled>
                                <option value=""></option>
                                <option value="1">是（采购抬头：上海沣奇）</option>
                                <option value="2">是（采购抬头：上海源铢）</option>
                                <option value="0" selected="selected">否</option>
                            </select>
                        </div>
                    </dd>
                    <dd class="layui-col-md3">
                        <div class="layui-col-xs4 text-right padding-right">
                            信保订单金额USD
                        </div>
                        <div class="layui-col-xs8">
                            <input type="text" name="creditGuaranteeAmount" id="creditGuaranteeAmount" value="0" readonly="readonly" autocomplete="off" class="layui-input">
                        </div>
                    </dd>
                    <dd class="layui-col-md3">
                        <div class="layui-col-xs4 text-right padding-right">
                            销售合同号
                        </div>
                        <div class="layui-col-xs8"> <input type="text" name="salesContractNo" id="salesContractNo" autocomplete="off" class="layui-input" lay-verify="required"></div>
                    </dd>
                    <dd class="layui-col-md3">
                        <div class="layui-col-xs4 text-right padding-right">
                            客户等级
                        </div>
                        <div class="layui-col-xs8">
                            <input type="text" name="customerLevelName" id="customerLevelName" autocomplete="off" class="layui-input" >
                            <input type="hidden" name="customerLevelCode" id="customerLevelCode">
                        </div>
                    </dd>
                    <dd class="layui-col-md3">
                        <div class="layui-col-xs4 text-right padding-right">
                            瓶底是否指定Logo
                        </div>
                        <div class="layui-col-xs8">
                            <select lay-search name="modeOfTrade" id="modeOfTrade">
                                <option value="0"></option>
                                <option value="1">不指定</option>
                                <option value="2">指定光面</option>
                                <option value="3">指定客户Logo</option>
                                <option value="4">指定Rtco Logo</option>
                            </select>
                        </div>
                    </dd>
                    <dd class="layui-col-md3">
                        <div class="layui-col-xs4 text-right padding-right">
                            <text>是否补货</text>
                        </div>
                        <div class="layui-col-xs8">
                            <select lay-search name="whetherToReplenish" id="whetherToReplenish" lay-filter="whetherToReplenish" disabled>
                                <option value=""></option>
                                <option value="1">是</option>
                                <option value="0">否</option>
                            </select>
                        </div>
                    </dd>
                    <dd class="layui-col-md3">
                        <div class="layui-col-xs4 text-right padding-right">
                            CAPA号
                        </div>
                        <div class="layui-col-xs8">
                            <input type="text" name="customerComplaintNo" id="customerComplaintNo" readonly="readonly" autocomplete="off" class="layui-input">
                        </div>
                    </dd>
                    <dd class="layui-col-md3">
                        <div class="layui-col-xs4 text-right padding-right">
                            备注
                        </div>
                        <div class="layui-col-xs8"> <textarea id="remark" name="remark" placeholder="" class="layui-textarea"></textarea></div>
                    </dd>
                </dl>
                <%--                over--%>


                <div class="layui-row">
                    <div class="layui-col-xs12">
                        <div class="layui-tab layui-tab-card">
                            <ul class="layui-tab-title">
                                <li class="layui-this">产品</li>
<%--                                <li class="">费用</li>--%>
                                <li class="">附件</li>
                                <li class="">日志</li>
                            </ul>
                            <div class="layui-tab-content">
                                <div  class="layui-tab-item  layui-show">
                                    <table class="layui-table" id="storageproducts" lay-filter="storageproductstable"></table>
                                </div>
<%--                                <div class="layui-tab-item">--%>
<%--                                    <table class="layui-table" id="cost" lay-filter="costtable"></table>--%>
<%--                                </div>--%>
                                <div class="layui-tab-item">
                                    <table class="layui-table" id="attachment" lay-filter="attachmenttable"></table>
                                </div>
                                <div class="layui-tab-item"><table class="layui-table" id="otherwarehouselog" lay-filter="logtable"></table></div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="padding text-right">
                    <button type="button" class="layui-btn" lay-submit="" lay-filter="form-element">立即提交</button>
                </div>
            </form>
        </div>
    </div>
</div>

<div class="layui-upload" id="attachmentupload" style="display: none;padding: 10px">
    <a type="button" class="layui-btn layui-btn-normal" id="uploadfile">选择文件</a>
    <div class="layui-upload-list">
        <table class="layui-table">
            <thead>
            <tr><th>文件名</th>
                <th>大小</th>
                <th>状态</th>
                <th>操作</th>
            </tr></thead>
            <tbody id="uploadlist"></tbody>
        </table>
    </div>
    <a type="button" class="layui-btn" id="testListAction">开始上传</a>
</div>
<script type="text/html" id="productcodeselect">
    <div class="layui-input-inline">
        <div class="layui-form-select ySearchSelect y_{{d.id}}" data-id="{{d.id}}">
            <div class="layui-input">{{d.productcode==undefined?"":d.productcode}}</div>
            <i class="layui-edge"></i>
            <table class="layui-table zdy" id="productcodeselect_{{d.id}}" lay-filter="productcodeselecttable_{{d.id}}"></table>
        </div>
    </div>
</script>

<script type="text/html" id="materialSupplierSelect">
    <select name="materialSupplier" class="materialSupplier" id="materialSupplier_{{d.tempId}}" lay-filter="materialSupplierSelect_filter" lay-search>
        <option value=""> </option>
    </select>
</script>

<script type="text/html" id="grossweightselect">
    <select name="grossweightselect" lay-filter="grossweightselect_filter">
        <option value="{{d.grossweight}}">{{d.grossweight==undefined?"":d.grossweight}}</option>
        <option value="text1">text1</option>
        <option value="text2">text2</option>
    </select>
</script>

<script type="text/html" id="colourScript">
    <select id="colour_{{d.tempId==undefined?d.id:d.tempId}}" class="colourSelect" lay-filter="colourSelect_filter">
    </select>
</script>
<script type="text/html" id="unitScript">
    <select id="unit_{{d.tempId==undefined?d.id:d.tempId}}" class="unitSelect" lay-filter="unitSelect_filter">
    </select>
</script>

<script type="text/html" id="costtypeselect">
    <select name="costtypeselect" lay-filter="costtypeselect_filter">
        <option value="{{d.costtype}}">{{d.costtype==undefined?"":d.costtype}}</option>
        <option value="text1">text1</option>
        <option value="text2">text2</option>
    </select>
</script>

<script type="text/html" id="storageproductstoolbar">
    <a class="layui-btn accessories" lay-event="stockupfinished">导入备货成品</a>
    <a class="layui-btn accessories" lay-event="stockupaccessories">导入备货配件</a>
    <a class="layui-btn finishedProduct" lay-event="salesoffinished">导入销售成品</a>
    <a class="layui-btn finishedProduct"  lay-event="salesaccessories">导入销售配件</a>
    <a class="layui-btn layui-btn-danger" lay-event="dels">删除</a>
</script>
<script type="text/html" id="productsEditor">
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>

<script type="text/html" id="attachmenttoolbar">
    <a class="layui-btn" data-type="getCheckData" lay-event="uploadfile">上传</a>
</script>
<script type="text/html" id="attachmenteditor">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="download">下载</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
<%@ include file="../../tpl/foot.jsp"%>
<script src="statics/js/ExportBusiness/tpl/newupprocurement.js"></script>
<script src="statics/js/bignumber.js"></script>